﻿using Microsoft.Practices.CompositeUI.WinForms;
using Microsoft.Practices.CompositeUI;
using SmartClientDevelopmentSolution1.Infrastructure.Interface;
using SmartClientDevelopmentSolution1.Infrastructure.Interface.Constants;


namespace SmartClientDevelopmentSolution1.MyActionModule
{
    public class ModuleActions
    {
        private WorkItem _workItem = null;

        [ServiceDependency]
        public WorkItem WorkItem
        {
            get { return _workItem; }
            set { _workItem = value; }
        }

        [Action(ActionNames.showMyView)]
        public void showMyView(object caller, object target)
        {
            IView view = WorkItem.Items.AddNew<View>();
            WindowSmartPartInfo info = new WindowSmartPartInfo();
            info.MaximizeBox = false;
            info.MinimizeBox = false;
            info.Modal = true;
            info.Title = "Action Catalog";
            
            WorkItem.Workspaces[WorkspaceNames.ModalWindows].Show(view, info);
        }

        [Action(ActionNames.showBadView)]
        public void showBadView(object caller, object target)
        {
            IBadView view = WorkItem.Items.AddNew<BadView>();
            WorkItem.Workspaces[WorkspaceNames.ModalWindows].Show(view);
        }
    }
}
